home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shw_piertrap.cog < prev    next >
Text File  |  1999-11-15  |  5KB  |  174 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_Door.cog
  4. #
  5. # Generic Door Script
  6. #
  7. # [IS]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.         
  14.     message    startup    
  15.     message    entered    
  16.     message    arrived        
  17.     message    touched        
  18.             
  19.     #    PROPS
  20.     thing        pier0           linkid=1
  21.     thing        pier1           linkid=1        
  22.     thing        pier2           linkid=1        
  23.     
  24.     #    ACTORS
  25.     thing        player          local                  
  26.  
  27.     #    CAMERAS
  28.     thing        camera                  
  29.  
  30.     
  31.     #    TRIGGERS
  32.     surface     trigger0        linkid=2
  33.     surface     trigger1        linkid=2
  34.     surface     trigger2        linkid=2
  35.     surface     trigger3        linkid=2
  36.     surface     trigger4        linkid=2
  37.     surface     trigger5        linkid=2
  38.     surface     trigger6        linkid=2
  39.     surface     trigger7        linkid=2
  40.     surface     trigger8        linkid=2
  41.     surface     trigger9        linkid=2
  42.     surface     trigger10       linkid=2
  43.     surface     trigger11       linkid=2
  44.         
  45.     sector  trapArea            linkID=3
  46.     sector  cueArea                
  47.         
  48.     #    SOUNDS
  49.     sound   blockhit=nub_stonedoor_stop_c.wav    local
  50.     sound   blockprime=teo_teobut_pull_c.wav    local
  51.     sound   blockdrop=nub_3mledge_stop_c.wav    local
  52.     
  53.     #MUSIC AND VOICE LINES
  54.     sound   dangercue=mus_gen_danger2.wav        local
  55.     sound   in_sensetrap=INXJ042.wav        local
  56.     
  57.     #    TEMPLATES
  58.     template    tempRef=indy_actor       
  59.  
  60.     #    KEYFRAMES
  61.     keyframe    inDie=in_die_buckle.key     local
  62.     
  63.     #    VARS
  64.     flex    fallSpeed=8.0
  65.     flex    sleepTime=.25
  66.     int     sprung=0    local
  67.     int     cued=0        local
  68.     int     clicked=0    local
  69.     int        curCam        local
  70.     int        safe=0        local
  71.     int     dead=0          local
  72.  
  73. end
  74.  
  75. # ========================================================================================
  76.  
  77. code
  78.  
  79. startup:
  80.  
  81.         player = GetLocalPlayerThing();
  82.         return;
  83.  
  84.  
  85. # ========================================================================================
  86. entered:
  87.         If ((GetSenderID() == 3) && (clicked == 0))
  88.                 {
  89.                 clicked = 1;
  90.                 PlaySoundLocal(blockprime, 1.0, 0, 0x0000, 1);
  91.                 }
  92.         
  93.         If ((GetSenderRef() == cueArea) && (cued == 0))
  94.                 {
  95.                 cued = 1;
  96.                 PlaySoundLocal(dangercue, 1.0, 0.0, 0x0, 0);
  97.                 Sleep(0.5);
  98.                 PlayVoice(player, in_sensetrap, 1.0, 0);
  99.                 }
  100.                 
  101.  
  102.         
  103.         If ((GetSenderID() == 2) && (sprung == 1)) return;
  104.         If ((GetSenderID() == 2) && (sprung == 0))
  105.                 {
  106.                 sprung = 1;
  107.                 curCam = GetCurrentCamera();
  108.                 SetCurrentCamera(2);
  109.                 SetCameraFocus(2, camera);
  110.                 SetCamerasecondaryFocus(2, player);
  111.                 sleep(.4);
  112.                 PlaySoundLocal(blockdrop, .25, 0, 0x0000, 0);
  113.                 movetoframe(pier0, 1, fallSpeed);
  114.                 sleep(sleepTime);
  115.                 PlaySoundLocal(blockdrop, .25, 0, 0x0000, 0);
  116.                 movetoframe(pier1, 1, fallSpeed);
  117.                 sleep(sleepTime);
  118.                 PlaySoundLocal(blockdrop, .25, 0, 0x0000, 0);
  119.                 movetoframe(pier2, 1, fallSpeed);
  120.                 sprung = 1;
  121.                 sleep(.5);
  122.                 SetCurrentCamera(curCam);
  123.                 SetCameraFocus(curCam, player);
  124.                 }
  125.                 
  126.         return;
  127. # ........................................................................................
  128.  
  129. arrived:
  130.  
  131.     if (GetSenderID() == 1)
  132.                 {
  133.             PlaySoundLocal(blockhit, 1.0, 0, 0x0000, 0);
  134.                 }
  135.         if (GetSenderRef() == pier2)
  136.                 {
  137.                 safe = 1;
  138.                 }        
  139.              return;
  140.  
  141. # ........................................................................................
  142.  
  143. touched:
  144.         if ((dead == 1) || (safe == 1))
  145.             {
  146.         return;
  147.             }
  148.         if(GetSenderID() == 1)
  149.         {
  150.                 DamageThing(player, 1000.0, 0x1, (GetSenderRef()));
  151.         Print("Player Damaged");
  152.         SetCollideType(pier0, 0);
  153.         SetCollideType(pier1, 0);
  154.         SetCollideType(pier2, 0);
  155.         
  156.         # Disable and hide player
  157.         SetThingFlags(player, 0x80000);
  158.         
  159.         deadIndy = CreateThing(tempRef, player);
  160.         CaptureThing(deadIndy);
  161.         
  162.         # Show actor Indy and play Keyframe
  163.         ClearThingFlags(deadIndy, 0x80000);
  164.         PlayKey(deadIndy, inDie, 10, 0x14, 0);
  165.  
  166.             dead = 1;
  167.                 }
  168.                 
  169. return;
  170. # ........................................................................................
  171.  
  172. end
  173.  
  174.